function sum(a,b) {
    console.log(arguments)
    // console.log(arguments[2])
    console.log(a)
    console.log(b)
    var total = 0
    // for(var i=0;i<arguments.length;i++){
    //     total += arguments[i]
    // }
    for(var i in arguments){
        console.log(i)
    }
    return total
}

var obj1 = {
    name:'jack',
    age:20,
    fav:'swmming'
}
for(var i in obj1){
    console.log(i)
}
// function bar(){
//     return 1
// }
// bar()
// function bar(name){
//     console.log('bar is calling')
//     console.log(`hello ${name}`)
//     return 1
// }
// bar('张三')

(function bar(name){
    console.log('bar is calling')
    console.log(`hello ${name}`)
    return 1
})('zhangsan')